﻿using DevTeam;

using System;
namespace ConfExpert.Forms.Depo
{
    public partial class GeriDonen : XPopupForm
    {
        public GeriDonen()
        {
            InitializeComponent();
        }

        private void GeriDonen_Load(object sender, EventArgs e)
        {

            txtCikisEmri.EditValueChanged += txtCikisEmri_EditValueChanged;
        }

        void txtCikisEmri_EditValueChanged(object sender, EventArgs e)
        {
            gridView2.Init("GetDonen", txtCikisEmri.EditValue.ToInt());
            gridView2.AddDetailGrid(gridView3, "ProductId");
            gridView1.Init(gridView2.Dataset().Tables[2]);

            gridView3.Columns["YeniBrandId"].ColumnEdit = RI(Rp.Brand);
            gridView3.Columns["YeniSezonId"].ColumnEdit = RI(Rp.Sezon);
            gridView1.Columns["CikilanAtelyeId"].ColumnEdit = RI(Rp.Atelye);
            gridView1.FormatAsDate("CikisTarihi");
            gridView3.FormatAsDate("AyrimTarihi", "GirisTarihi");
            gridView3.FormatAsNumber(1, "Qty", "YeniQty");
            gridView3.AddSummary("Qty", "YeniQty");

            gridView2.FormatAsNumber(1, "ToplamCikilan", "ToplamDonen");
            gridView2.AddSummary("ToplamCikilan", "ToplamDonen");

            gridView1.BestFitColumns();
            gridView2.BestFitColumns();
            gridView3.BestFitColumns();
        }
    }
}
